Skip to content

Conversation

@josh-ramos-22
Copy link
Contributor

Why are the changes required?

Currently, there is no way to style text as code.
Being a society for Computer Science, CSESoc articles will inevitably need to have some integrated code styling.

Changes

  • New file frontend/src/cse-ui-kit/small_buttons/CodeButton.tsx: contains button component used to toggle code styling.
  • New SVG file frontend/src/cse-ui-kit/assets/code-button.svg for the CodeButton component
  • frontend/src/packages/editor/components/EditorBlock.tsx
    • added code styles required in the Text styled component
  • New file frontend/src/packages/editor/components/buttons/EditorCodeButton.tsx: Defines code button in editor used to toggle code styling
  • frontend/src/packages/editor/components/buttons/buttonHelpers.ts
    • Added code to denote code as a valid text decoration
    • added event handler case to enable Ctrl ` as the keyboard shortcut for code style toggling.
  • frontend/src/packages/editor/types.ts
    • added code to the type definition of CustomText

Screenshots

Screenshot 2023-04-05 205214

Copy link
Contributor

@lauraw0 lauraw0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! pls check comments and then merge whenever 👍

@josh-ramos-22 josh-ramos-22 merged commit 4a7f9a2 into main Apr 6, 2023
@josh-ramos-22 josh-ramos-22 deleted the WEB_28_EDITOR_Implement_code_blocks branch April 6, 2023 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants